import Vue from "vue";
import Vuex from "vuex";
import getters from "./getters";
import app from "./modules/app";
import settings from "./modules/settings";
import user from "./modules/user";

Vue.use(Vuex);

const store = new Vuex.Store({
  // 模块化
  modules: {
    app,
    settings,
    user,
  },
  // 根getters
  getters: getters,
  // getters: {
  //   // sidebar: (state) => {
  //   //   console.log(state); // 根模块state
  //   //   // state.app 相当于我们 读取了app模块的state
  //   //   return state.app.sidebar;
  //   // },
  //   sidebar: (state) => state.app.sidebar,
  // },
  // getters,
});

export default store;
